Regular expression in mySQL [migrated]

Posted by Rayne on Super User See other posts from Super User or by Rayne
Published on 2012-03-27T10:47:23Z Indexed on 2012/03/27 11:32 UTC
Read the original article Hit count: 193

Filed under:
|

I have a mysql table that has 2 columns - Column 1 contains a string value, and Column 2 contains the number of times that string value occurred.

I'm trying to find the string abc.X.def, where the beginning of the string is "abc.", followed by one or more characters, then the string ".def". There could be more characters following ".def".

How can I find such strings, then add the occurrence of such strings and display the results?

For example, if I have

abc.111.def23   1
abc.111.def     2
abc.22.def444   1
abc.111.def     1

Then I will get

abc.111.def23   1
abc.111.def     3
abc.22.def444   1

Thank you.

© Super User or respective owner

Related posts about mysql

Related posts about regex